<?php
namespace Framework;

interface PageComponent {
	/**
	 * Implement this to ensure that required JS files are included once, and only once.
	 * @return Return an array of paths. They can be absolute or relative, but be consistent
	 * because the require mechanism isn't going to resolve relative paths. 
	 */
	public function getJSIncludes();
	
	/**
	 * Implement this to ensure that required stylesheets are included once, and only once.
	 * @return Return an array of paths. They can be absolute or relative, but be consistent
	 * because the require mechanism isn't going to resolve relative paths. 
	 */
	public function getStylesheets();
	
	/**
	 * Main render function that renders HTML. Ideally this shouldn't contain any script tags.
	 * @return Return a block of HTML as a string.
	 */
	public function render();
	
	/**
	 * If you have JS scripts that need to be executed on document.ready, they should go at the 
	 * end of the page so the browser can start rendering the page earlier. All getScript() blocks
	 * will be rendered at the end of the page (immediately before </body>). 
	 * @return Return arbitrary JavaScript (including the <script> tags) as a string. 
	 */
	public function getScript();
}